<template>
  <div>
    <entry-cell name="手机号" :need-border-bottom="true" @callClick="pushToBindPhonePage">
      <span class="tel">{{tel}}</span>
    </entry-cell>
    <entry-cell :name="isSetPwd?'修改登录密码':'设置登录密码'"  @callClick="pushToPWDModifyPage"/>
  </div>
</template>

<script>
import EntryCell from './components/EntryCell'
import {AppRouterUtils, UserBeanUtils} from 'vue-xiaobu-utils'
export default{
  components: {
    EntryCell
  },
  data() {
    return {
      isSetPwd: UserBeanUtils.getUserInfo().ISSET_PASSWD === 1 || UserBeanUtils.getUserInfo().ISSET_PASSWD === '1'
    }
  },
  computed: {
    tel() {
      return UserBeanUtils.getUserPhone()
    }
  },
  mounted() {
    document.addEventListener('resume', () => {
      this.isSetPwd = UserBeanUtils.getUserInfo().ISSET_PASSWD === 1 || UserBeanUtils.getUserInfo().ISSET_PASSWD === '1'
    })
  },
  methods: {
    pushToBindPhonePage() {
      // 跳转到绑定手机的页面
      AppRouterUtils.open('city-app/bindphone.html')
    },
    pushToPWDModifyPage() {
      // 跳转到修改密码的页面
      let url = this.isSetPwd ? 'city-app/modifyloginpwd.html' : 'city-app/setloginpwd.html'
      AppRouterUtils.open(url)
    }
  }
}
</script>

<style>
  * {
    margin: 0;
    padding: 0;
  }
  html,
  body {
    height: 100%;
    background-color: #F2F5F6;
  }
  /* 修复css边距合并带来的问题 */
  body {
    position: absolute;
    width: 100%;
  }
  #app {
    height: 100%;
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    position: relative;
  }
  .tel{
    color:#000000;
    font-size:16px;/*no*/
    line-height:24px;/*no*/
    margin-right:160px;
  }

</style>
